#include <iostream>
#include <cstdio>
using namespace std;
int main() {
	char s[1000], max_w[1000], c;
	int start = 0, end = start, i = 0, max_len = -1, tmp_len = -1;
	while ((c = getchar()) != '.') {
		s[i++] = c;
	}
	s[i] = 0;
	i = 0;
	for (; s[i] != 0; i++) {
		//start=i;
		if (s[i + 1] == ' ' or s[i + 1] == 0) {
			end = i + 1;
			tmp_len = end - start;
			if (max_len < tmp_len) {
				max_len = tmp_len;
				for (int j = start; j < end; j++) {
					max_w[j - start] = s[j];
				}
				max_w[end - start] = 0;
			}
			start = end + 1;
		}
	}
//	if (s[i] == ' ' or s[i] == 0) {
//		end = i;
//		tmp_len = end - start;
//		if (max_len < tmp_len) {
//			max_len = tmp_len;
//			tmp_w = s[end] - s[start];
//			max_w = tmp_w;
//		}
//		start = i + 1;
//	}
	cout << max_w;
//	cout <<  << endl << max_len;
	return 0;
}
